<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="${pageContext.request.contextPath}/statics/bootstrap-3.3.5-dist/css/bootstrap.min.css" title="" rel="stylesheet" />
<link title="" href="${pageContext.request.contextPath}/statics/css/style.css" rel="stylesheet" type="text/css"  />
<link title="blue" href="${pageContext.request.contextPath}/statics/css/dermadefault.css" rel="stylesheet" type="text/css"/>
<link title="green" href="${pageContext.request.contextPath}/statics/css/dermagreen.css" rel="stylesheet" type="text/css" disabled="disabled"/>
<link title="orange" href="${pageContext.request.contextPath}/statics/css/dermaorange.css" rel="stylesheet" type="text/css" disabled="disabled"/>
<link href="${pageContext.request.contextPath}/statics/css/templatecss.css" rel="stylesheet" title="" type="text/css" />
<script src="${pageContext.request.contextPath}/statics/js/jquery-1.12.4.js"></script>
<script src="${pageContext.request.contextPath}/statics/script/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/statics/script/jquery.cookie.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/statics/bootstrap-3.3.5-dist/js/bootstrap.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath }/statics/ckeditor/ckeditor.js"></script>
<style type="text/css">
	
	a{text-decoration:none;} 
	.max:hover{
		width: 20%;
		height: 20%;
	}
</style>

<script type="text/javascript">
    window.onload = function()
    {
        CKEDITOR.replace( 'description');
        CKEDITOR.replace( 'description1');
        CKEDITOR.replace( 'description2');
    };
</script>
<script>
     function fileSelect(elementId){
     document.getElementById(elementId).click();
	document.getElementById("show1").style.backgroundImage = "url('')";
	$("#img1").hide();
     }
     function showImage(file,id){
            var div = document.getElementById(id);


            if (file.files && file.files[0])
            {
                div.innerHTML ='<img id=img_'+id+'>';
                var img = document.getElementById('img_'+id);
                img.onload = function(){
                    img.width  =  "100";
                }
                var reader = new FileReader();
                reader.onload = function(evt){img.src = evt.target.result;}
                reader.readAsDataURL(file.files[0]);
            }
            else //兼容IE
            {
                var sFilter='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
                file.select();
                var src = document.selection.createRange().text;
                div.innerHTML ='<img id=img_'+id+'>';
                var img = document.getElementById('img_'+id);
                img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
                var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
                status =('rect:'+rect.top+','+rect.left+','+rect.width+','+rect.height);
                div.innerHTML = "<div id=divhead style='width:"+rect.width+"px;height:"+rect.height+"px;margin-top:"+rect.top+"px;"+sFilter+src+"\"'></div>";
            }
        }
</script>
<script>
     function fileSelect(elementId){
     document.getElementById(elementId).click();
	document.getElementById("show11").style.backgroundImage = "url('')";
     }
     function showImage(file,id){
            var div = document.getElementById(id);


            if (file.files && file.files[0])
            {
                div.innerHTML ='<img id=1img_'+id+'>';
                var img = document.getElementById('1img_'+id);
                img.onload = function(){
                    img.width  =  "100";
                }
                var reader = new FileReader();
                reader.onload = function(evt){img.src = evt.target.result;}
                reader.readAsDataURL(file.files[0]);
            }
            else //兼容IE
            {
                var sFilter='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
                file.select();
                var src = document.selection.createRange().text;
                div.innerHTML ='<img id=1img_'+id+'>';
                var img = document.getElementById('1img_'+id);
                img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
                var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
                status =('rect:'+rect.top+','+rect.left+','+rect.width+','+rect.height);
                div.innerHTML = "<div id=1divhead style='width:"+rect.width+"px;height:"+rect.height+"px;margin-top:"+rect.top+"px;"+sFilter+src+"\"'></div>";
            }
        }
</script>
<script>
     function fileSelect(elementId){
     document.getElementById(elementId).click();
	document.getElementById("show12").style.backgroundImage = "url('')";
     }
     function showImage(file,id){
            var div = document.getElementById(id);


            if (file.files && file.files[0])
            {
                div.innerHTML ='<img id=2img_'+id+'>';
                var img = document.getElementById('2img_'+id);
                img.onload = function(){
                    img.width  =  "100";
                }
                var reader = new FileReader();
                reader.onload = function(evt){img.src = evt.target.result;}
                reader.readAsDataURL(file.files[0]);
            }
            else //兼容IE
            {
                var sFilter='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="';
                file.select();
                var src = document.selection.createRange().text;
                div.innerHTML ='<img id=2img_'+id+'>';
                var img = document.getElementById('2img_'+id);
                img.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = src;
                var rect = clacImgZoomParam(MAXWIDTH, MAXHEIGHT, img.offsetWidth, img.offsetHeight);
                status =('rect:'+rect.top+','+rect.left+','+rect.width+','+rect.height);
                div.innerHTML = "<div id=2divhead style='width:"+rect.width+"px;height:"+rect.height+"px;margin-top:"+rect.top+"px;"+sFilter+src+"\"'></div>";
            }
        }
</script>

</head>
<body>

               
               
               <!-------信息列表------->
               <div class="row newslist" style="margin-top:20px;">
                 <div class="col-md-8">
                   <div class="panel panel-default">
                      <div class="panel-heading">
                       吐槽烽火台<div class="caret"></div>
                       <a href="#" class="pull-right"><span class="glyphicon glyphicon-refresh"></span></a>
                      </div>     
                     <!-- <div class="panel-body">
                           <div class="w15 pull-left">
                             <img src="img/noavatar_middle.gif" width="25" height="25" alt="图片" class="img-circle">
                             安妮
                           </div>
                           <div class="w55 pull-left">系统需要升级</div>
                           <div class="w20 pull-left text-center">2016年8月23日</div>
                          <div class="w10 pull-left text-center"><span class="text-green-main">处理中</span></div>
                      </div>
                       -->
                       
                       
                       <!-- 循环吐槽开始 -->
                       		<c:forEach items="${page.list}" var="list">
			<div style="border-bottom: 1px solid #D0D0D0;" >
				<div style="width: 88%;position:relative; left: 40px;">
					<a href="" style="text-decoration:none;">
						<img src="${list.headimg}" class="constellation" style="border-radius: 50%;" width="50px;" height="50px;" alt="" />
					</a>
					&nbsp;
					<span style="vertical-align:text-top; font-size: 15px; "><a class="a" style="text-decoration:none;color:#319DE5; " href="">
						${list.username}
					</a>
					<c:if test="${list.userrole==1}">
						<span style="background-color: #FF9707;border-radius: 15px;color: #FFFFFF;">&nbsp;&nbsp;楼管&nbsp;&nbsp;</span>
					</c:if>
						<span style="font-size: 4px;float: right;right: 0px;">
						<c:if test="${list._userid==userlogin.userid}">
						<a target="main" href="${pageContext.request.contextPath}/complaints/deleteComplaints?complaintsid=${list.complainid}&pageNo=${page.pageNo}" onclick="return confirm('确认要删除这条吐槽吗？')" style="text-decoration: none;"><img src="${pageContext.request.contextPath}/statics/images/delete.jpg" alt="" width="16px;" height="16px" />&nbsp;删除</a>
						</c:if>
						</span>
					</span>
					<br />
						<span style="font-size: 4px;position: relative;top: -20px;left: 63px;">${list.jointime}</span>
				</div>
				<div style=" width: 90%; position:relative; left: 100px;">
					<div>${list.context }</div>
					<br />
					<div>
						<c:if test="${not empty list.contextimg}"><img class="max" width="15%" height="15%" src="${list.contextimg}" alt="" /></c:if>
						<c:if test="${empty list.contextimg}"></c:if>
					</div>
					<p align="right">
						<input type="hidden" class="dianzan" name="postid" value="" />
					</p>
					<p align="center"><a target="main" href="${pageContext.request.contextPath}/comment/queryAllComment?complaintsid=${list.complainid}" style="text-decoration: none;"><img src="${pageContext.request.contextPath}/statics/images/pinglun.jpg" style="width: 18px" height="18px" alt="" />&nbsp;&nbsp;查看评论</a></p>
				</div>
			</div>
		</c:forEach>
		<table>
		<tr>
				<td width="81.6%" >共 ${page.totalPageCount} 页|第 ${page.pageNo} 页</td>
				<td style="text-align: right;" >
				<c:if test="${page.pageNo==1 and page.pageNo<page.totalPageCount}">
					<span>首页</span>
					<span>上一页</span>
					<a href="${pageContext.request.contextPath}/users/toshouye?pageNo=${page.pageNo+1}">下一页</a>
					<a href="${pageContext.request.contextPath}/users/toshouye?pageNo=${page.totalPageCount}">末页</a>
				</c:if>
				<c:if test="${page.pageNo>1 and page.pageNo<page.totalPageCount}">
					<a href="${pageContext.request.contextPath}/users/toshouye?pageNo=1">首页</a>
					<a href="${pageContext.request.contextPath}/users/toshouye?pageNo=${page.pageNo-1}">上一页</a>
					<a href="${pageContext.request.contextPath}/users/toshouye?pageNo=${page.pageNo+1}">下一页</a>
					<a href="${pageContext.request.contextPath}/users/toshouye?pageNo=${page.totalPageCount}">末页</a>
				</c:if>
				<c:if test="${page.pageNo == page.totalPageCount and page.totalPageCount!=1}">
					<a href="${pageContext.request.contextPath}/users/toshouye?pageNo=1">首页</a>
					<a href="${pageContext.request.contextPath}/users/toshouye?pageNo=${page.pageNo-1}">上一页</a>
					<span>下一页</span>
					<span>末页</span>
				</c:if>
				<c:if test="${page.pageNo==1 and page.totalPageCount==1}">
					已经到底了……
				</c:if>
				</td>
			</tr>
		</table>
                       <!-- 循环吐槽结束 -->
                       
                       
                       
                        
                 
                      
                 
                      
                  
                
                 
                      
                      <div class="panel-body text-center">
                      </div>
                      
                    </div>
                 </div>
                <c:if test="${userlogin.userrole==2}">
                 <div class="col-md-4">
                     <div class="panel panel-default">
                      <div class="panel-heading">
                       我的报修事项
                       <a href="#" class="pull-right"><span class="glyphicon glyphicon-refresh"></span></a>
                      </div>     
                      <div class="panel-body" style="overflow: scroll;height: 600px;">
                          <c:forEach items="${list}" var="list">
                          	<div>${list.context}</div><br />
                          	<span style="color: gray;">${list.jointime}
                          	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          	<c:if test="${list.status==1}"><a target="_top" href="${pageContext.request.contextPath}/repair/updateRepair?repairid=${list.repairid}&status=${list.status}" onclick="return confirm('确认要放弃报修吗？')" style="text-decoration: none;"><img src="${pageContext.request.contextPath}/statics/images/cha.png" alt="" width="16px;" height="16px" />&nbsp;放弃报修</a></c:if>
                          	<c:if test="${list.status==2}"><a target="_top" href="${pageContext.request.contextPath}/repair/updateRepair?repairid=${list.repairid}&status=${list.status}" onclick="return confirm('确认要继续报修吗？')" style="text-decoration: none;"><img src="${pageContext.request.contextPath}/statics/images/dui.png" alt="" width="16px;" height="16px" />&nbsp;继续报修</a></c:if>
                          	</span>
                          	<hr />
                          </c:forEach>
                      </div>
                    </div>
                 </div>
                 </c:if> 
               </div>
  
</body>
</html>